<?php

namespace app\admin\validate;

use think\Validate;

class Article extends Validate
{
    protected $rule =   [
        'id|文章ID' => 'require',
        'cate_id|分类ID' => 'require',
        'title|标题'  => 'require',
        'content|内容'   => 'require',
        'score|阅读积分' => 'number|egt:0',
        'status|文章状态' => 'in:0,1,2',
        'type|文章类型' => 'in:1,2,3,4',
        'is_hot|是否加精' => 'in:0,1',
        'is_top|是否置顶' => 'in:0,1',
        'type|文章类型' => 'in:1,2,3,4'
    ];
    protected $message  =   [];
    protected $scene  =   [
        'edit' => ['id', 'type', 'score','status','is_top','is_hot'],
        'add' => ['title', 'cate_id', 'content', 'type', 'score']
    ];
}
